public class Mthread3 implements Runnable{
    private int deposition = 0;


    @Override
    public void run() {
        for (int i = 0;i < 3;i ++ ) deposit(1000);
    }

    private synchronized  void deposit(int sum) {
        deposition += sum;
        System.out.println(Thread.currentThread().getName() + " " + deposition);
    }

}
